package com.primb.bench.project.home.entity;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.List;

/**
 * Created by Chen on 2017/5/9.
 * 功能描述：贷款测算信息实体类
 */

public class EnsureInfoEntity implements Parcelable {
    /**
     * 担保信息
     */
    String ensureMainType;//主担保方式
    String ensureMainTypeId;//主担保方式Id
    String ensureConcretenessType;//具体担保方式
    String ensureConcretenessTypeId;//具体担保方式ID
    private String lnFinImpawnAmt = "0";
    private String lnAcctRecvAmt = "0";
    private String lnPropertyAmt = "0";
    private String lnOthMortAmt = "0";
    private String highGuarantee = "0";
    private String commonGuarantee = "0";
    boolean isEnsureInfoEmpty = true;

    public String getHighGuarantee() {
        return highGuarantee;
    }

    public void setHighGuarantee(String highGuarantee) {
        if (!highGuarantee.equals(""))
            this.highGuarantee = highGuarantee;
    }

    public String getCommonGuarantee() {
        return commonGuarantee;
    }

    public void setCommonGuarantee(String commonGuarantee) {
        if (!commonGuarantee.equals(""))
        this.commonGuarantee = commonGuarantee;
    }

    public String getLnFinImpawnAmt() {
        return lnFinImpawnAmt;
    }

    public void setLnFinImpawnAmt(String lnFinImpawnAmt) {
        if (!lnFinImpawnAmt.equals(""))
        this.lnFinImpawnAmt = lnFinImpawnAmt;
    }

    public String getLnAcctRecvAmt() {
        return lnAcctRecvAmt;
    }

    public void setLnAcctRecvAmt(String lnAcctRecvAmt) {
        if (!lnAcctRecvAmt.equals(""))
        this.lnAcctRecvAmt = lnAcctRecvAmt;
    }

    public String getLnPropertyAmt() {
        return lnPropertyAmt;
    }

    public void setLnPropertyAmt(String lnPropertyAmt) {
        if (!lnPropertyAmt.equals(""))
        this.lnPropertyAmt = lnPropertyAmt;
    }

    public String getLnOthMortAmt() {
        return lnOthMortAmt;
    }

    public void setLnOthMortAmt(String lnOthMortAmt) {
        if (!lnOthMortAmt.equals(""))
        this.lnOthMortAmt = lnOthMortAmt;
    }

    public String getEnsureMainTypeId() {
        return ensureMainTypeId;
    }

    public void setEnsureMainTypeId(String ensureMainTypeId) {
        this.ensureMainTypeId = ensureMainTypeId;
    }

    public String getEnsureConcretenessTypeId() {
        return ensureConcretenessTypeId;
    }

    public void setEnsureConcretenessTypeId(String ensureConcretenessTypeId) {
        this.ensureConcretenessTypeId = ensureConcretenessTypeId;
    }

    public String getEnsureMainType() {
        return ensureMainType;
    }

    public void setEnsureMainType(String ensureMainType) {
        this.ensureMainType = ensureMainType;
    }

    public String getEnsureConcretenessType() {
        return ensureConcretenessType;
    }

    public void setEnsureConcretenessType(String ensureConcretenessType) {
        this.ensureConcretenessType = ensureConcretenessType;
    }

    public boolean isEnsureInfoEmpty() {
        return isEnsureInfoEmpty;
    }

    public void setEnsureInfoEmpty(boolean ensureInfoEmpty) {
        isEnsureInfoEmpty = ensureInfoEmpty;
    }

    public EnsureInfoEntity() {
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.ensureMainType);
        dest.writeString(this.ensureMainTypeId);
        dest.writeString(this.ensureConcretenessType);
        dest.writeString(this.ensureConcretenessTypeId);
        dest.writeString(this.lnFinImpawnAmt);
        dest.writeString(this.lnAcctRecvAmt);
        dest.writeString(this.lnPropertyAmt);
        dest.writeString(this.lnOthMortAmt);
        dest.writeString(this.highGuarantee);
        dest.writeString(this.commonGuarantee);
        dest.writeByte(this.isEnsureInfoEmpty ? (byte) 1 : (byte) 0);
    }

    protected EnsureInfoEntity(Parcel in) {
        this.ensureMainType = in.readString();
        this.ensureMainTypeId = in.readString();
        this.ensureConcretenessType = in.readString();
        this.ensureConcretenessTypeId = in.readString();
        this.lnFinImpawnAmt = in.readString();
        this.lnAcctRecvAmt = in.readString();
        this.lnPropertyAmt = in.readString();
        this.lnOthMortAmt = in.readString();
        this.highGuarantee = in.readString();
        this.commonGuarantee = in.readString();
        this.isEnsureInfoEmpty = in.readByte() != 0;
    }

    public static final Creator<EnsureInfoEntity> CREATOR = new Creator<EnsureInfoEntity>() {
        @Override
        public EnsureInfoEntity createFromParcel(Parcel source) {
            return new EnsureInfoEntity(source);
        }

        @Override
        public EnsureInfoEntity[] newArray(int size) {
            return new EnsureInfoEntity[size];
        }
    };
}
